import React, { Component } from 'react';
import Taro from '@tarojs/taro';
import { Empty } from '@antmjs/vantui';
import './index.scss'

/**
    * 如果是本地图片资源 应该在 assets 下面开始写 ，require动态记载图片报错
    */
interface PdsEmptyProp {
    placeholderImage?: string,
    placeholderText?: string,
}

class PdsEmpty extends Component<PdsEmptyProp, any> {

    config = {
        navigationBarTitleText: ''
    }

    state = {}

    /**
    * 设置props 默认值
    */
    static defaultProps = {
        placeholderImage: require(`@/assets/images/public_placeholder_nodata.png`),
        placeholderText: '暂无数据',
    };

    constructor(props) {
        super(props);
    }

    componentWillMount() { }
    componentDidMount() { }
    componentWillReceiveProps(nextProps, nextContext) { }
    componentWillUnmount() { }
    render() {
        const { placeholderImage, placeholderText,  } = this.props
        console.log(placeholderImage)
        return (
            <Empty class="pds-empty"
                image={placeholderImage}
                description={placeholderText}></Empty>
        )
    }
}

export default PdsEmpty;